<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!--这个就是运行后第一次打开的页面 用作 登录界面 放在了WEB-INF外面-->
<%@ include file="/login/page/include/taglib.jsp" %>
<%--/login/page/include/taglib.jsp--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">

    <link rel="stylesheet" href="css/style.css">

    <script>
        var ctx = "${ctx}";  //因为下面引入的login.js中会用到ctx变量
    </script>

    <title>注册</title>

   <style type="text/css">

     #bg_img {
         position: absolute;
         width: 100%;
         height: 100%;
     }

     #promotion{
         float: left;
         position: absolute;
         left: 25%;
         top: 27%;
         background: url(${ctx}/image/1.png);
         font-family: KaiTi;
         font-size: 450%;
         align-content: center;
     }
   </style>
</head>

<body>
    <img src="image/back_061.jpg" id="bg_img">

    <a href="/promotion/promotionList" id="promotion">点击查看医院公告</a>

    <div class="login-main" style="top:35%;height: auto;">

        <header class="layui-elip">用户注册</header>

        <form class="layui-form" lay-filter="login">
            <input type="hidden" name="opr" value="register">
            <div class="layui-input-inline">
                <input id="hzName" name="hzName" type="text" placeholder="用户名" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input id="hzPwd" name="hzPwd" type="password" placeholder="密码" class="layui-input">
            </div>

            <div class="layui-input-inline">
                <div style="background: rgb(255,255,255);padding-left: 10px" >
                    男：<input id="hzSex" name="hzSex" type="radio" value="男">
                    女： <input id="hzSex2" name="hzSex" type="radio" value="女">
                </div>
            </div>
            <div class="layui-input-inline">
                <input id="birth" name="birth" type="date" placeholder="生日" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input id="hzPhone" name="hzPhone" type="text" placeholder="联系电话" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input id="shenFen" name="shenFen" type="text" placeholder="省份证" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input id="hzEamil" name="hzEamil" type="text" placeholder="邮箱" class="layui-input">
            </div>
            <div class="layui-input-inline">
                <input id="hzAddress" name="hzAddress" type="text" placeholder="居住地址" class="layui-input">
            </div>
        <div class="layui-input-inline">
            <input id="password" type="password" placeholder="密码" class="layui-input">
        </div>
        <div class="layui-btn layui-btn-radius layui-btn-warm" style="margin-left: 5px">
            <button type="button" class="layui-btn layui-btn-warm" onclick="tj()">注册</button>
        </div>
        </form>

    </div>

    <script type="text/javascript" src="layui/layui.js"></script>
    <script type="text/javascript" src="js/login.js"></script>
    <script type="text/javascript" src="js/pubilc.js"></script>
</body>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
    function tj(){
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzPwd").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        if(isNull($("#hzName").val())){
            alert("名字不能为空！")
        }
        $.getJSON("/login.do",$("form").serializeArray(),function(result){
            if(result != null){
                alert("注册成功！")
                window.location.href = "index.jsp";
            }else{
                alert("注册失败！")
            }
        })
    }

    function isNull(s) {
        return s==null||s===''||s===undefined;
    }
</script>
</html>






